Writing clear and effective prompts or rules for AI (.mdc files in Cursor) can be tricky. Your instructions might start out clumsy or ambiguous, leading to less-than-ideal AI responses. This lesson demonstrates how to quickly refine them by referencing a dedicated "best practices" rule file directly within Cursor's inline editor (Cmd+K
).
Workflow demonstrated in this lesson:
- Select the text (a prompt or section of a rule) you want to improve.
- Use
Cmd+K
to open the inline AI editor. - Reference your separate prompt best practices rule file using
@
(e.g.,@prompt-improve.mdc
). - Cursor's AI rewrites the selected text, applying the referenced best practices.
- Accept the improved version (
Cmd+Enter
). - (Bonus) Use
Cmd+L
to send the edited section to the Agent chat and ask it to compare the changes with the previous version (using git history) and explain why the new version is better (e.g., improved clarity, stronger action verbs, explicit exclusions).
Key benefits:
- Instantly improve prompt clarity and effectiveness based on your own defined standards stored in a rule file.
- Reduces ambiguity in instructions, leading to better AI outcomes.
- Leverages Cursor rules (
.mdc
files) as reusable templates for prompt refinement. - Provides insight into how and why prompts are improved via Agent comparison.
Stop wrestling with clunky prompts. Use this technique to systematically apply best practices and level up your AI instructions directly within Cursor.